﻿using System;
using System.Collections.Generic;

namespace NewsSystem.Models
{
    public class Article
    {
        private ICollection<Comment> comments;
        private ICollection<Vote> votes;
        private ICollection<Image> images;

        public Article()
        {
            this.comments = new HashSet<Comment>();
            this.votes = new HashSet<Vote>();
            this.images = new HashSet<Image>();
        }

        public int Id { get; set; }

        public string Title { get; set; }

        public string Content { get; set; }

        public DateTime CreationDate { get; set; }

        public virtual ICollection<Image> Images
        {
            get
            {
                return this.images;
            }

            set
            {
                this.images = value;
            }
        }

        public virtual ICollection<Vote> Votes
        {
            get
            {
                return this.votes;
            }

            set
            {
                this.votes = value;
            }
        }

        public virtual ICollection<Comment> Comments
        {
            get
            {
                return this.comments;
            }

            set
            {
                this.comments = value;
            }
        }

        public virtual User Author { get; set; }
    }
}